package com.bjx.api.system.service;

import com.bjx.api.system.domain.query.UserQuery;
import com.bjx.api.system.domain.vo.UserVO;
import com.bjx.api.system.service.fallback.RemoteUserFallBack;
import com.bjx.common.core.constant.ServiceNameConst;
import com.bjx.common.core.domain.R;
import com.bjx.common.security.interceptor.FeignInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @desc: 远程用户服务
 * @author: liushuai
 * @date: 2022/6/28 17:26
 */
@FeignClient(name = ServiceNameConst.SYSTEM,fallback = RemoteUserFallBack.class,path = "/user",configuration = FeignInterceptor.class)
public interface RemoteUserService {

    /**
     * 根据用户名查询用户信息
     * @param username
     * @return: com.bjx.common.core.domain.R<com.bjx.api.system.domain.vo.UserVO>
     * @Author: liushuai
     * @Date: 2022/11/18 20:06
     */
    @GetMapping(value = "/selectUserInfoByUsername")
    @ResponseBody
    R<UserVO> selectUserInfoByUsername(@RequestParam String username);

    /**
     * 根据用户id查询用户信息
     * @param userId
     * @return: com.bjx.common.core.domain.R<com.bjx.api.system.domain.vo.UserVO>
     * @Author: liushuai
     * @Date: 2022/11/18 20:07
     */
    @GetMapping(value = "/selectUserInfoByUserId")
    @ResponseBody
    R<UserVO> selectUserInfoByUserId(@RequestParam Long userId);

    /**
     * 根据用户id列表查询用户信息列表
     * @param userQuery
     * @return: com.bjx.common.core.domain.R<java.util.List<com.bjx.api.system.domain.vo.UserVO>>
     * @Author: liushuai
     * @Date: 2022/11/18 20:10
     */
    @PostMapping("listUserVOByIds")
    R<List<UserVO>> listUserVOByIds(@RequestBody UserQuery userQuery);
    /**
     * 根据组织机构和职位列表查询用户信息列表
     * @param userQuery
     * @return: com.bjx.common.core.domain.R<java.util.List<com.bjx.api.system.domain.vo.UserVO>>
     * @Author: liushuai
     * @Date: 2022/12/1 11:38
     */
    @PostMapping("listUserVOByOrgAndPosts")
    R<List<UserVO>> listUserVOByOrgAndPosts(@RequestBody UserQuery userQuery);

    /**
     * 根据角色id列表查询用户信息
     * @param userQuery
     * @return: com.bjx.common.core.domain.R<java.util.List<com.bjx.api.system.domain.vo.UserVO>>
     * @Author: liushuai
     * @Date: 2022/12/2 15:37
     */
    @PostMapping("listUserVOByRoleIds")
    R<List<UserVO>> listUserVOByRoleIds(@RequestBody UserQuery userQuery);

    /**
     * 根据职位id列表查询用户信息
     * @param userQuery
     * @return: com.bjx.common.core.domain.R<java.util.List<com.bjx.api.system.domain.vo.UserVO>>
     * @Author: liushuai
     * @Date: 2022/12/2 15:59
     */
    @PostMapping("listUserVOByPostIds")
    R<List<UserVO>> listUserVOByPostIds(@RequestBody UserQuery userQuery);

    /**
     * 根据组织机构id和角色id列表查询用户列表
     * @param userQuery
     * @return: com.bjx.common.core.domain.R<java.util.List<com.bjx.api.system.domain.vo.UserVO>>
     * @Author: liushuai
     * @Date: 2022/12/5 17:34
     */
    @PostMapping("listUserVOByOrgAndRoleIds")
    R<List<UserVO>> listUserVOByOrgAndRoleIds(@RequestBody UserQuery userQuery);
    /**
     * 根据公司id和角色id列表
     * @param userQuery
     * @return: com.bjx.common.core.domain.R<java.util.List<com.bjx.api.system.domain.vo.UserVO>>
     * @Author: liushuai
     * @Date: 2022/12/5 19:29
     */
    @PostMapping("listUserVOByComAndRoleIds")
    R<List<UserVO>> listUserVOByComAndRoleIds(@RequestBody UserQuery userQuery);

    /**
     * 根据公司id和职位列表查询用户列表
     * @param userQuery
     * @return: com.bjx.common.core.domain.R<java.util.List<com.bjx.api.system.domain.vo.UserVO>>
     * @Author: liushuai
     * @Date: 2023/6/26 21:40
     */
    @PostMapping("listUserVOByComAndPosts")
    R<List<UserVO>> listUserVOByComAndPosts(UserQuery userQuery);
}
